package camel.utils;

import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.ModelCamelContext;

public class CamelUtils {
	private  static ModelCamelContext camelContext = null;

	public static ModelCamelContext getInstanCamelContext() {
		if (camelContext == null) {
			camelContext = new DefaultCamelContext();
		}
		return camelContext;
	}

	public void start() throws Exception {
		if (camelContext != null) {
			camelContext.start();
		}
	}

	public void stop() throws Exception {
		if (camelContext != null) {
			camelContext.stop();
		}
	}
}
